opengnb: add opengnb 1.6.8 to openwrt - #29879
Conversation
There was a problem hiding this comment.
Pull request overview
Adds the opengnb package to the OpenWrt packages feed at version 1.6.5, enabling users to build/install OpenGNB (P2P decentralized virtual network/VPN) from the feed.
Changes:
- Introduces
net/opengnb/Makefiledefining the new package metadata, source fetch, and build/install steps. - Builds OpenGNB using the upstream
Makefile.openwrtand installsgnb,gnb_crypto, andgnb_ctlinto/usr/sbin.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
deeply need this feature, hope it can be accepted |
|
thanks |
|
These test errors are all occurring within Docker, mentioning: |
cab7043 to
013be9b
Compare
2aa84a9 to
d726341
Compare
openwrt-ai
left a comment
There was a problem hiding this comment.
Reviewed 2 new commits. CI (FormalityCheck) passes on the head commit; the earlier natpmpc test failures were resolved by dropping the miniupnpc/libnatpmp dependencies in the 1.6.6 update. Commit messages match their diffs. Two minor nits inline (file mode, series hygiene); no blocking issues found.
Generated by Claude Code
There was a problem hiding this comment.
nit: This Makefile is committed with executable mode 100755. Package Makefiles in this tree are non-executable (100644) — 1446 of them are 644 and only 3 are 755. Please reset the mode:
chmod 644 net/opengnb/Makefile
then amend the commit.
Generated by Claude Code
d726341 to
a72ccc9
Compare
5808f51 to
b171fdf
Compare
openwrt-ai
left a comment
There was a problem hiding this comment.
Reviewed 1 new commit; no new issues found. The two prior nits are resolved: the Makefile is now committed with mode 100644, and history was squashed into a single opengnb: add version 1.6.6 commit with the PR title/description updated to match PKG_VERSION. FormalityCheck CI passes on the head commit.
Generated by Claude Code
|
Hi all, I have fixed the license identifiers according to the guidelines and double-checked the package via local compilation. The CI is passing and it is ready for review. Could someone take a look when available? Thanks! |
Is there anything else that needs to be done? |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Suppressed comments (1)
net/opengnb/Makefile:45
- Build/Compile overrides
CFLAGSbut drops$(TARGET_CPPFLAGS)and hard-codes staging include/library paths. In this tree, manual-make packages typically pass bothCFLAGSandCPPFLAGS(e.g.net/pixiewps/MakefilesetsCFLAGSandCPPFLAGSseparately) so target sysroot include paths and hardening defines are preserved. Recommend moving-I.../-D...intoCPPFLAGS, include$(TARGET_CPPFLAGS), and avoid explicit-I$(STAGING_DIR)/usr/include/-L$(STAGING_DIR)/usr/libunless strictly required.
define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR) \
$(TARGET_CONFIGURE_OPTS) \
CFLAGS="$(TARGET_CFLAGS) -I. -I./src -I./libs -I$(STAGING_DIR)/usr/include -DWITHOUT_MINIUPNPC -D_GNU_SOURCE -DNO_GZIP=1 -DGNB_OPENWRT_BUILD=1" \
LDFLAGS="$(TARGET_LDFLAGS) -L$(STAGING_DIR)/usr/lib -lz -pthread" \
b171fdf to
889395f
Compare
889395f to
59bbd6b
Compare
59bbd6b to
385836d
Compare
openwrt-ai
left a comment
There was a problem hiding this comment.
Reviewed 1 new commit (385836d), which replaces the previously reviewed 1.6.6 state with 1.6.7.
What I verified as correct:
PKG_HASHmatches the upstreamopengnb-1.6.7.tar.gzrelease asset (c2e4aa17…f0443), andPKG_RELEASE:=1is right for a version bump.- The
Build/Compilesimplification holds up. 1.6.7'sMakefile.openwrtnow setsGNB_CFLAGS=$(CFLAGS) -I./src -I./libs -D_GNU_SOURCE -DNO_GZIP=1 -DWITHOUT_MINIUPNPC -DGNB_OPENWRT_BUILD=1itself, so dropping those flags here is not a behaviour change, and-DWITHOUT_MINIUPNPCis still applied — the missing miniupnpc/libnatpmp dependencies stay correct. - Dropping the explicit
allgoal is safe:allis the first target inMakefile.openwrtand the includedMakefile.openwrt.incdefines only variables, no rules, soallremains the default goal. - Removing
-I$(STAGING_DIR)/usr/include/-L$(STAGING_DIR)/usr/libis fine —$(TARGET_CPPFLAGS)and$(TARGET_LDFLAGS)already carry them. Dropping-lz -pthreadfromLDFLAGSis also fine: upstream adds them on thegnbandgnb_eslink lines, andgnb_ctl/gnb_cryptopull in neither zlib nor pthread. This addresses the earlier Copilot remark on the flag handling. - The commit message matches its diff.
Two substantive findings inline: gnb_es is linked without $(TARGET_LDFLAGS) because upstream shadows it with GNB_ES_LDFLAGS, so that binary ships without OpenWrt's hardening/linker flags; and all four binaries embed __DATE__/__TIME__, which upstream lets you switch off with a single define. I'd call the gnb_es link the one worth fixing before merge; the timestamp one is a reproducibility improvement rather than a blocker. The other two comments are optional nits.
On CI: only FormalityCheck has reported on this head commit and all three of its checks are green. The multi-arch test build has not posted a result yet, so there is nothing to read into it either way.
Generated by Claude Code
| $(MAKE) -C $(PKG_BUILD_DIR) \ | ||
| $(TARGET_CONFIGURE_OPTS) \ | ||
| CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \ | ||
| LDFLAGS="$(TARGET_LDFLAGS)" \ |
There was a problem hiding this comment.
$(TARGET_LDFLAGS) never reaches the gnb_es link. Upstream's Makefile.openwrt links that one binary with GNB_ES_LDFLAGS, which is a fresh assignment that does not reference $(LDFLAGS):
GNB_ES_LDFLAGS=-Wl,--gc-sections
...
$(GNB_ES): $(GNB_ES_OBJS) $(CRYPTO_OBJS)
$(CC) -o $(GNB_ES) $(GNB_ES_OBJS) $(CRYPTO_OBJS) $(GNB_ES_LDFLAGS) -pthreadgnb, gnb_ctl and gnb_crypto all link through GNB_LDFLAGS=$(LDFLAGS) and are fine, so of the four binaries installed below, gnb_es is the only one built without the flags OpenWrt puts in TARGET_LDFLAGS: -zrelro / -znow and the PIE specs from hardening.mk, plus -fuse-ld=$(TARGET_LINKER), -zmax-page-size, the toolchain -L paths and the LTO linker plugin when CONFIG_USE_LTO is set.
A variable set on the $(MAKE) command line overrides the makefile's own assignment, so passing it here is enough (-Wl,--gc-sections is kept explicitly because TARGET_LDFLAGS only picks it up when CONFIG_USE_GC_SECTIONS is enabled):
| LDFLAGS="$(TARGET_LDFLAGS)" \ | |
| LDFLAGS="$(TARGET_LDFLAGS)" \ | |
| GNB_ES_LDFLAGS="$(TARGET_LDFLAGS) -Wl,--gc-sections" \ |
Generated by Claude Code
| define Build/Compile | ||
| $(MAKE) -C $(PKG_BUILD_DIR) \ | ||
| $(TARGET_CONFIGURE_OPTS) \ | ||
| CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \ |
There was a problem hiding this comment.
All four installed binaries embed a compile timestamp, which makes the package non-reproducible — the same source built twice yields different binaries. src/gnb_version.h in the 1.6.7 tarball has:
#ifndef GNB_SKIP_BUILD_TIME
#define GNB_BUILD_STRING "Build Time ["__DATE__","__TIME__"]"
#else
#define GNB_BUILD_STRING "Build Time [Hidden]"
#endifand GNB_BUILD_STRING is referenced from src/cli/gnb.c, gnb_ctl.c, gnb_crypto.c and gnb_es.c, so every one of them is affected. Upstream already provides the opt-out, so defining it here is the whole fix. Feed packages handle build stamps the same way — see net/ratched/Makefile:17 (-DBUILD_TIMESTAMP_UTC="\"unknown\"") and net/socat/Makefile:83 (BUILD_DATE=$(SOURCE_DATE_EPOCH)).
| CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \ | |
| CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) -DGNB_SKIP_BUILD_TIME" \ |
Generated by Claude Code
| endef | ||
|
|
||
| define Build/Compile | ||
| $(MAKE) -C $(PKG_BUILD_DIR) \ |
There was a problem hiding this comment.
nit (cosmetic, optional): the padding before the continuation backslash on this line is a mix of 7 spaces, 2 literal tabs and 15 more spaces, so the \ lands well past the column the next three lines align to and the block renders ragged at any tab width. The other three lines pad with spaces only. Harmless to the build — the continuation just folds into the recipe as whitespace — but it looks unintentional:
| $(MAKE) -C $(PKG_BUILD_DIR) \ | |
| $(MAKE) -C $(PKG_BUILD_DIR) \ |
Generated by Claude Code
| endef | ||
|
|
||
| define Package/opengnb/install | ||
| $(INSTALL_DIR) $(1)/usr/sbin |
There was a problem hiding this comment.
nit / question: gnb is a long-running daemon, but the package installs only the four binaries — there is no /etc/init.d/opengnb and no /etc/config/opengnb, so nothing starts the VPN at boot and there is no UCI surface to configure it. The feed's convention for daemons is a procd init script (#!/bin/sh /etc/rc.common, USE_PROCD=1, start_service()), with any shipped config registered in define Package/opengnb/conffiles.
I can't tell from the diff whether this is deliberate. Worth noting the 1.6.7 tarball ships only a systemd unit (scripts/opengnb@.service) and a examples/node_config_example tree, so there is nothing to install verbatim — an init script would have to be written for this package. Is that planned as a follow-up, or is manual invocation the intent for the initial submission?
Generated by Claude Code
385836d to
6d18701
Compare
openwrt-ai
left a comment
There was a problem hiding this comment.
Reviewed 1 new commit (6d18701), which replaces the previously reviewed 1.6.7 state with 1.6.8. Nothing blocking; one optional cosmetic nit inline.
What I verified:
PKG_HASH:=4c6a6030…f829matches the upstreamopengnb-1.6.8.tar.gzrelease asset (downloaded and hashed independently), andPKG_RELEASE:=1is correct for a version bump.- Both substantive findings from my 1.6.7 review are fixed upstream in 1.6.8, so no change is needed in this Makefile for either.
Makefile.openwrtnow readsGNB_ES_LDFLAGS=$(LDFLAGS)(was-Wl,--gc-sections), sognb_esfinally links with$(TARGET_LDFLAGS)like the other three binaries; andGNB_CFLAGSgained-DGNB_SKIP_BUILD_TIME=1, so none of the four binaries embeds__DATE__/__TIME__any more (src/gnb_version.hnow resolvesGNB_BUILD_STRINGto"Build Time [Hidden]"). The two corresponding inline threads from the last review are stale and can be resolved. - The full 1.6.7 → 1.6.8 upstream diff is confined to the per-platform
Makefile.*,src/gnb_version.handversion— no new sources and no new library usage — soDEPENDS:=+kmod-tun +libpthread +zlibis still accurate:gnbstill links-lz -pthread, and-DWITHOUT_MINIUPNPCis still set, so the miniupnpc/libnatpmp dependencies stay correctly absent. - Omitting an explicit make goal is still safe:
allremains the first target inMakefile.openwrt, andMakefile.openwrt.incstill defines only object-list variables, no rules. - The commit message matches its diff, carries a
Signed-off-by, and the file is committed with mode100644.
CI: the three FormalityCheck jobs are green on the head commit. The multi-arch test build has not reported on this commit yet, so there is nothing to read into it either way.
Still open from the previous round: the question about whether a procd init script (/etc/init.d/opengnb) and a UCI config are planned, since gnb is a long-running daemon and the package currently installs binaries only. That thread has not been answered.
Generated by Claude Code
04fb620 to
403d211
Compare
openwrt-ai
left a comment
There was a problem hiding this comment.
Reviewed 1 new commit (403d211); no new issues found.
The only change since the previously reviewed state is the cosmetic alignment nit from my last round: the LDFLAGS="$(TARGET_LDFLAGS)" continuation line now pads with a single space like the three lines around it, so the whole Build/Compile block is consistent. Nothing else in net/opengnb/Makefile moved — PKG_VERSION/PKG_RELEASE/PKG_HASH, DEPENDS, the recipe body and the install block are byte-identical to what I verified at 1.6.8, the file is still committed with mode 100644, and the commit subject matches its diff.
Housekeeping on the older inline threads, so the list reflects reality:
- The
gnb_es/$(TARGET_LDFLAGS)thread and the__DATE__/__TIME__reproducibility thread are both stale — 1.6.8 fixes each upstream (GNB_ES_LDFLAGS=$(LDFLAGS)and-DGNB_SKIP_BUILD_TIME=1inMakefile.openwrt), so no change is needed here. They can be resolved. - Still unanswered from two rounds ago: whether a procd init script (
/etc/init.d/opengnb) and a UCI config are planned.gnbis a long-running daemon and the package currently installs binaries only, so nothing starts it at boot. Not a blocker for an initial submission if that is the intent — it would just be good to say so on the record.
Generated by Claude Code
OpenGNB does not require a configuration file; the daemon process can be started directly via a command in the terminal window. |
Add the OpenGNB package so the P2P decentralized virtual network can be built and installed on OpenWrt. Use the target compiler and linker flags, then install the OpenGNB command-line utilities. Signed-off-by: charles chan <hollidgelongsun157@gmail.com>
403d211 to
0bac353
Compare
Update opengnb package to the latest version 1.6.8.
📦 Package Details
PKG_MAINTAINER:= Charles Chan hollidgelongsun157@gmail.com
opengnb: add version 1.6.8 to openwrt
Description:
OpenGNB is an open source P2P decentralized Software Defined Virtual Network with extreme intranet penetration capability,Allows you to combine your company-home network into a direct-access LAN.
All code related to the GNB project is released as open source, and the currently released source code supports the following platforms: FreeBSD Linux OpenWRT Raspberrypi OpenBSD macOS
GNB Features
Intranet penetration P2P VPN
No public IP required
Extreme link capability
Unlimited speed effects
Data Security
Reliable authentication between GNB nodes based on elliptic curve digital signature
Multi-platform support
GNB is developed in C language. It does not need to refer to third-party library files when compiling. It can be easily ported to the current popular operating systems. Currently supported operating systems and platforms include Linux_x86_64, Windows10_x86_64, macOS, FreeBSD_AMD64, OpenBSD_AMD64, Raspberry Pi, OpenWRT; as big as server environment, desktop system, as small as OpenWRT router with only 32M memory can run GNB network very well.
🧪 Run Testing Details
**OpenWrt Version:OpenWrt SNAPSHOT, r35007-9f385a71a7
**OpenWrt Target/Subtarget:x86/x86_64
**OpenWrt Device:intel NUC 11
✅ Formalities